<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>居中</title>
    <style>
        body {
            padding: 0;
            margin: 0;
            border: 0;
            height: 100vh;
            width: 100vw;
        }

        .main {
            width: 820px;
            /* height: 60%; */
            position: relative;
            top: 10%;
            left: 50%;
            padding: 10px;
            transform: translate(-50%, 0);
            background-color: #FFCCCC;
        }

        .showBlock {
            display: inline-block;
            position: relative;
            width: 150px;
            height: 230px;
            margin: 15px;
            padding: 10px;
            /* padding: 10px; */
            background-color: #CCCCFF;
        }

        .up {
            position: absolute;
            height: 90px;
            width: 150px;
            /* margin-bottom: 10px; */
            top: 10px;
            background-color: #CCFFCC;
        }

        .down {
            position: absolute;
            top: 120px;
            height: 120px;
            width: 150px;
            background-color: #CCFFCC;
        }
    </style>
</head>

<body>
    <div class="main">
        <div class="showBlock">
            <div class="up"></div>
            <div class="down"></div>
        </div>
        <div class="showBlock">
            <div class="up"></div>
            <div class="down"></div>
        </div>
        <div class="showBlock">
            <div class="up"></div>
            <div class="down"></div>
        </div>
        <div class="showBlock">
            <div class="up"></div>
            <div class="down"></div>
        </div>
        <div class="showBlock">
            <div class="up"></div>
            <div class="down"></div>
        </div>
        <div class="showBlock">
            <div class="up"></div>
            <div class="down"></div>
        </div>
        <div class="showBlock">
            <div class="up"></div>
            <div class="down"></div>
        </div>
    </div>
</body>


</html>